<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div class="test"></div>
  </body>
</html>
<style>
  .test {
    width: 100px;
    height: 100px;
    background-color: rgb(196, 223, 44);
    position: relative;
  }
  .test::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border:2px dashed #8149c1;
    background-color: rgba(28, 112, 237, 0.5); /* 这里设置遮罩的颜色和透明度 */
  }
</style>
